// components/sizeification/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    size:{type:Array,required:true},
    way:{type:Array,required:true},
    message:{type:Object,required:true}
  },

  /**
   * 组件的初始数据
   */
  data: {
    sizeActive:0,
    wayActive:0,
    // 备注
    iptText:''
  },

  /**
   * 组件的方法列表
   */
  methods: {
    selectHandle({
      target: {
        dataset: {
          cate,
          idx
        }
      }
    }) {
      if(cate=='sizeActive'){
        this.setData({sizeActive:idx })
      }else{
        this.setData({wayActive:idx })
      }
      console.log(this.properties.size);
      
    },
    cancelHandle(){
      this.triggerEvent('close')
      console.log(this.properties.propId)
    },
    okHandle(){
      let data= {
        size:this.data.size[this.data.sizeActive],
        way:this.data.way[this.data.wayActive],
        remark:this.data.iptText
      }
      this.triggerEvent('onSuccess',data)
    },
    iptHandle({detail:{value}}){
      this.setData({
        iptText:value
      })
    }
  }
})